package com.qunar.wan.common_api.model;

import com.qunar.wan.common_api.DateUtil;
import com.qunar.wan.common_api.model.enums.ActivityState;
import com.qunar.wan.common_api.serializer.DateSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * User: cyoung Date: 11/26/13 Time: 10:45 AM
 */
public class Activity implements Serializable {
    private static final long serialVersionUID = 8178269327868064375L;
    private int id;
    private String title;
    private int subClaId;
    private int userId;
    private Timestamp createTime;
    private Date deadline;
    private Date startTime;
    private Date endTime;
    private String place;
    private String description;
    private int avgFee;
    private int peopleLimit;
    private String poster;
    private ActivityState state;
    private int better;
    private int good;
    private int bad;
    private int score;
    private int peopleNum;
    private String checkComment;
    private String startDay;
    private String startHHMM;
    private String endDay;
    private String endHHMM;
    private String classifyName;
    private String subClassifyName;
    private int classifyId;
    private String sponor;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getSubClaId() {
        return subClaId;
    }

    public void setSubClaId(int subClaId) {
        this.subClaId = subClaId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @JsonSerialize(using = DateSerializer.class)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @JsonSerialize(using = DateSerializer.class)
    public Date getDeadline() {
        return deadline;
    }

    public void setDeadline(Date deadline) {
        this.deadline = deadline;
    }

    @JsonSerialize(using = DateSerializer.class)
    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    @JsonSerialize(using = DateSerializer.class)
    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getPlace() {
        return place;
    }

    public void setPlace(String place) {
        this.place = place;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getAvgFee() {
        return avgFee;
    }

    public void setAvgFee(int avgFee) {
        this.avgFee = avgFee;
    }

    public int getPeopleLimit() {
        return peopleLimit;
    }

    public void setPeopleLimit(int peopleLimit) {
        this.peopleLimit = peopleLimit;
    }

    public String getPoster() {
        return poster;
    }

    public void setPoster(String poster) {
        this.poster = poster;
    }

    public ActivityState getState() {
        return state;
    }

    public void setState(ActivityState state) {
        this.state = state;
    }

    public int getBetter() {
        return better;
    }

    public void setBetter(int better) {
        this.better = better;
    }

    public int getGood() {
        return good;
    }

    public void setGood(int good) {
        this.good = good;
    }

    public int getBad() {
        return bad;
    }

    public void setBad(int bad) {
        this.bad = bad;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public int getPeopleNum() {
        return peopleNum;
    }

    public void setPeopleNum(int peopleNum) {
        this.peopleNum = peopleNum;
    }

    public String getCheckComment() {
        return checkComment;
    }

    public void setCheckComment(String checkComment) {
        this.checkComment = checkComment;
    }

    public String getStartDay() {
        return startDay != null ? startDay : getStartTime() != null ? DateUtil.getDay(getStartTime()) : null;
    }

    public String getStartHHMM() {
        return startHHMM != null ? startHHMM : getStartTime() != null ? DateUtil.getHHMM(getStartTime()) : null;
    }

    public String getEndDay() {
        return endDay != null ? endDay : getEndTime() != null ? DateUtil.getDay(getEndTime()) : null;
    }

    public String getEndHHMM() {
        return endHHMM != null ? endHHMM : getEndTime() != null ? DateUtil.getHHMM(getEndTime()) : null;
    }

    public String getClassifyName() {
        return classifyName;
    }

    public void setClassifyName(String classifyName) {
        this.classifyName = classifyName;
    }

    public String getSubClassifyName() {
        return subClassifyName;
    }

    public void setSubClassifyName(String subClassifyName) {
        this.subClassifyName = subClassifyName;
    }

    public int getClassifyId() {
        return classifyId;
    }

    public void setClassifyId(int classifyId) {
        this.classifyId = classifyId;
    }

    public String getSponor() {
        return sponor;
    }

    public void setSponor(String sponor) {
        this.sponor = sponor;
    }

    @Override
    public String toString() {
        return "Activity{" + "classifyId=" + classifyId + ", id=" + id + ", title='" + title + '\'' + ", subClaId="
                + subClaId + ", userId=" + userId + ", createTime=" + createTime + ", deadline=" + deadline
                + ", startTime=" + startTime + ", endTime=" + endTime + ", place='" + place + '\'' + ", description='"
                + description + '\'' + ", avgFee=" + avgFee + ", peopleLimit=" + peopleLimit + ", poster='" + poster
                + '\'' + ", state=" + state + ", better=" + better + ", good=" + good + ", bad=" + bad + ", score="
                + score + ", peopleNum=" + peopleNum + ", checkComment='" + checkComment + '\'' + ", startDay='"
                + startDay + '\'' + ", startHHMM='" + startHHMM + '\'' + ", endDay='" + endDay + '\'' + ", endHHMM='"
                + endHHMM + '\'' + ", classifyName='" + classifyName + '\'' + ", subClassifyName='" + subClassifyName
                + '\'' + ", sponor='" + sponor + '\'' + '}';
    }
}
